3dhall12i2c 2.2.0
Loading...
Searching...
No Matches
c3dhall12i2c.h File Reference

This file contains API for 3D Hall 12 I2C Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  c3dhall12i2c_t
 3D Hall 12 I2C Click context object. More...
struct  c3dhall12i2c_cfg_t
 3D Hall 12 I2C Click configuration object. More...
struct  c3dhall12i2c_data_t
 3D Hall 12 I2C Click data object. More...

Macros

#define C3DHALL12I2C_REG_NOP   0x00
 3D Hall 12 I2C register list.
#define C3DHALL12I2C_REG_INDIRECT_WR_ADDRESS   0x02
#define C3DHALL12I2C_REG_INDIRECT_WR_DATA_MSB   0x04
#define C3DHALL12I2C_REG_INDIRECT_WR_DATA_LSB   0x06
#define C3DHALL12I2C_REG_INDIRECT_WR_STATUS   0x08
#define C3DHALL12I2C_REG_INDIRECT_RD_ADDRESS   0x0A
#define C3DHALL12I2C_REG_INDIRECT_RD_STATUS   0x0C
#define C3DHALL12I2C_REG_INDIRECT_RD_DATA_MSB   0x0E
#define C3DHALL12I2C_REG_INDIRECT_RD_DATA_LSB   0x10
#define C3DHALL12I2C_REG_I2C_LOOP_BACK   0x12
#define C3DHALL12I2C_REG_I2C_X_Y_8B   0x14
#define C3DHALL12I2C_REG_I2C_T_Z_8B   0x16
#define C3DHALL12I2C_REG_I2C_ANGLE_RADIUSSQ_8B   0x18
#define C3DHALL12I2C_REG_I2C_SIN_COS_8B   0x1A
#define C3DHALL12I2C_REG_TEMPERATURE   0x1C
#define C3DHALL12I2C_REG_X_CHANNEL   0x1E
#define C3DHALL12I2C_REG_Y_CHANNEL   0x20
#define C3DHALL12I2C_REG_Z_CHANNEL   0x22
#define C3DHALL12I2C_REG_ANGLE   0x24
#define C3DHALL12I2C_REG_RADIUS   0x26
#define C3DHALL12I2C_REG_SINE   0x28
#define C3DHALL12I2C_REG_COSINE   0x2A
#define C3DHALL12I2C_REG_X_RAW_FILT_OUT   0x2C
#define C3DHALL12I2C_REG_Y_RAW_FILT_OUT   0x2E
#define C3DHALL12I2C_REG_Z_RAW_FILT_OUT   0x30
#define C3DHALL12I2C_REG_CTRL1   0x32
#define C3DHALL12I2C_REG_I2C_LOOPB_CONF   0x34
#define C3DHALL12I2C_REG_CTRL2   0x36
#define C3DHALL12I2C_REG_CTRL3   0x38
#define C3DHALL12I2C_REG_CTRL4   0x3A
#define C3DHALL12I2C_REG_RESERVED   0x3C
#define C3DHALL12I2C_REG_ACCESS_KEY   0x3E
#define C3DHALL12I2C_CTRL1_START_SAMPLE_CLEAR   0x0000
 3D Hall 12 I2C CTRL1 register setting.
#define C3DHALL12I2C_CTRL1_START_SAMPLE_SET   0x1000
#define C3DHALL12I2C_CTRL1_START_SAMPLE_MASK   0x1000
#define C3DHALL12I2C_CTRL1_INTERRUPT_FLAG_CLEAR   0x0000
#define C3DHALL12I2C_CTRL1_INTERRUPT_FLAG_SET   0x0800
#define C3DHALL12I2C_CTRL1_INTERRUPT_FLAG_MASK   0x0800
#define C3DHALL12I2C_CTRL1_STATUS_READY_CLEAR   0x0000
#define C3DHALL12I2C_CTRL1_STATUS_READY_SET   0x0400
#define C3DHALL12I2C_CTRL1_STATUS_READY_MASK   0x0400
#define C3DHALL12I2C_CTRL1_SLEEP_CNT_0_68_MS   0x0000
#define C3DHALL12I2C_CTRL1_SLEEP_CNT_1_36_MS   0x0010
#define C3DHALL12I2C_CTRL1_SLEEP_CNT_6_82_MS   0x0020
#define C3DHALL12I2C_CTRL1_SLEEP_CNT_13_64_MS   0x0030
#define C3DHALL12I2C_CTRL1_SLEEP_CNT_68_18_MS   0x0040
#define C3DHALL12I2C_CTRL1_SLEEP_CNT_136_36_MS   0x0050
#define C3DHALL12I2C_CTRL1_SLEEP_CNT_681_82_MS   0x0060
#define C3DHALL12I2C_CTRL1_SLEEP_CNT_1363_64_MS   0x0070
#define C3DHALL12I2C_CTRL1_SLEEP_CNT_MASK   0x0070
#define C3DHALL12I2C_CTRL1_OP_MODE_ACTIVE   0x0000
#define C3DHALL12I2C_CTRL1_OP_MODE_ACTIVE_INT   0x0002
#define C3DHALL12I2C_CTRL1_OP_MODE_ACTIVE_SAM   0x0004
#define C3DHALL12I2C_CTRL1_OP_MODE_SLEEP   0x0006
#define C3DHALL12I2C_CTRL1_OP_MODE_SLEEP_SAM   0x0008
#define C3DHALL12I2C_CTRL1_OP_MODE_LPDCM_INT   0x000A
#define C3DHALL12I2C_CTRL1_OP_MODE_LPDCM   0x000C
#define C3DHALL12I2C_CTRL1_OP_MODE_MASK   0x000E
#define C3DHALL12I2C_CTRL2_INT_THR_MSB_DIR_MASK   0x0F00
 3D Hall 12 I2C CTRL2 register setting.
#define C3DHALL12I2C_CTRL2_INT_THR_LSB_DIR_MASK   0x00FF
#define C3DHALL12I2C_CTRL3_AFE_CHAN_DIS_Z_DIR_EN   0x0000
 3D Hall 12 I2C CTRL3 register setting.
#define C3DHALL12I2C_CTRL3_AFE_CHAN_DIS_Z_DIR_DIS   0x2000
#define C3DHALL12I2C_CTRL3_AFE_CHAN_DIS_Z_DIR_MASK   0x2000
#define C3DHALL12I2C_CTRL3_AFE_CHAN_DIS_Y_DIR_EN   0x0000
#define C3DHALL12I2C_CTRL3_AFE_CHAN_DIS_Y_DIR_DIS   0x1000
#define C3DHALL12I2C_CTRL3_AFE_CHAN_DIS_Y_DIR_MASK   0x1000
#define C3DHALL12I2C_CTRL3_AFE_CHAN_DIS_X_DIR_EN   0x0000
#define C3DHALL12I2C_CTRL3_AFE_CHAN_DIS_X_DIR_DIS   0x0800
#define C3DHALL12I2C_CTRL3_AFE_CHAN_DIS_X_DIR_MASK   0x0800
#define C3DHALL12I2C_CTRL3_POL_F_Z_DIR_NORMAL   0x0000
#define C3DHALL12I2C_CTRL3_POL_F_Z_DIR_INVERTED   0x0400
#define C3DHALL12I2C_CTRL3_POL_F_Z_DIR_MASK   0x0400
#define C3DHALL12I2C_CTRL3_POL_F_Y_DIR_NORMAL   0x0000
#define C3DHALL12I2C_CTRL3_POL_F_Y_DIR_INVERTED   0x0200
#define C3DHALL12I2C_CTRL3_POL_F_Y_DIR_MASK   0x0200
#define C3DHALL12I2C_CTRL3_POL_F_X_DIR_NORMAL   0x0000
#define C3DHALL12I2C_CTRL3_POL_F_X_DIR_INVERTED   0x0100
#define C3DHALL12I2C_CTRL3_POL_F_X_DIR_MASK   0x0100
#define C3DHALL12I2C_CTRL3_INT_SEL_DIR_X   0x0000
#define C3DHALL12I2C_CTRL3_INT_SEL_DIR_Y   0x0008
#define C3DHALL12I2C_CTRL3_INT_SEL_DIR_Z   0x0010
#define C3DHALL12I2C_CTRL3_INT_SEL_DIR_ABS_X   0x0018
#define C3DHALL12I2C_CTRL3_INT_SEL_DIR_ABS_Y   0x0020
#define C3DHALL12I2C_CTRL3_INT_SEL_DIR_ABS_Z   0x0028
#define C3DHALL12I2C_CTRL3_INT_SEL_DIR_TEMP   0x0030
#define C3DHALL12I2C_CTRL3_INT_SEL_DIR_ANGLE   0x0038
#define C3DHALL12I2C_CTRL3_INT_SEL_DIR_RADIUS   0x0040
#define C3DHALL12I2C_CTRL3_INT_SEL_DIR_NEW_SAMPLE   0x0048
#define C3DHALL12I2C_CTRL3_INT_SEL_DIR_MASK   0x0078
#define C3DHALL12I2C_CTRL3_INT_SIGN_DIR_LESS   0x0000
#define C3DHALL12I2C_CTRL3_INT_SIGN_DIR_GREATER   0x0004
#define C3DHALL12I2C_CTRL3_INT_SIGN_DIR_MASK   0x0004
#define C3DHALL12I2C_CTRL3_INT_FLAG_LATCH_DIR_DIS   0x0000
#define C3DHALL12I2C_CTRL3_INT_FLAG_LATCH_DIR_EN   0x0002
#define C3DHALL12I2C_CTRL3_INT_FLAG_LATCH_DIR_MASK   0x0002
#define C3DHALL12I2C_CTRL3_SAMPLE_INT_POL_DIR_LOW   0x0001
#define C3DHALL12I2C_CTRL3_SAMPLE_INT_POL_DIR_HIGH   0x0001
#define C3DHALL12I2C_CTRL3_SAMPLE_INT_POL_DIR_MASK   0x0001
#define C3DHALL12I2C_CTRL4_CIC_BW_SEL_LPM_DIR_195_5_HZ   0x0000
 3D Hall 12 I2C CTRL4 register setting.
#define C3DHALL12I2C_CTRL4_CIC_BW_SEL_LPM_DIR_391_HZ   0x0100
#define C3DHALL12I2C_CTRL4_CIC_BW_SEL_LPM_DIR_782_HZ   0x0200
#define C3DHALL12I2C_CTRL4_CIC_BW_SEL_LPM_DIR_1564_HZ   0x0300
#define C3DHALL12I2C_CTRL4_CIC_BW_SEL_LPM_DIR_3128_HZ   0x0400
#define C3DHALL12I2C_CTRL4_CIC_BW_SEL_LPM_DIR_6256_HZ   0x0500
#define C3DHALL12I2C_CTRL4_CIC_BW_SEL_LPM_DIR_12512_HZ   0x0600
#define C3DHALL12I2C_CTRL4_CIC_BW_SEL_LPM_DIR_MASK   0x0700
#define C3DHALL12I2C_CTRL4_CIC_BW_SEL_DIR_195_5_HZ   0x0000
#define C3DHALL12I2C_CTRL4_CIC_BW_SEL_DIR_391_HZ   0x0010
#define C3DHALL12I2C_CTRL4_CIC_BW_SEL_DIR_782_HZ   0x0020
#define C3DHALL12I2C_CTRL4_CIC_BW_SEL_DIR_1564_HZ   0x0030
#define C3DHALL12I2C_CTRL4_CIC_BW_SEL_DIR_3128_HZ   0x0040
#define C3DHALL12I2C_CTRL4_CIC_BW_SEL_DIR_6256_HZ   0x0050
#define C3DHALL12I2C_CTRL4_CIC_BW_SEL_DIR_12512_HZ   0x0060
#define C3DHALL12I2C_CTRL4_CIC_BW_SEL_DIR_MASK   0x0070
#define C3DHALL12I2C_CTRL4_CORDIC_POL_DIR_NORMAL   0x0000
#define C3DHALL12I2C_CTRL4_CORDIC_POL_DIR_INVERTED   0x0008
#define C3DHALL12I2C_CTRL4_CORDIC_POL_DIR_MASK   0x0008
#define C3DHALL12I2C_CTRL4_CORDIC_SEL_DIR_COS_X_SINE_Y   0x0000
#define C3DHALL12I2C_CTRL4_CORDIC_SEL_DIR_COS_X_SINE_Z   0x0001
#define C3DHALL12I2C_CTRL4_CORDIC_SEL_DIR_COS_Y_SINE_Z   0x0002
#define C3DHALL12I2C_CTRL4_CORDIC_SEL_DIR_COS_Y_SINE_X   0x0003
#define C3DHALL12I2C_CTRL4_CORDIC_SEL_DIR_COS_Z_SINE_X   0x0004
#define C3DHALL12I2C_CTRL4_CORDIC_SEL_DIR_COS_Z_SINE_Y   0x0005
#define C3DHALL12I2C_CTRL4_CORDIC_SEL_DIR_MASK   0x0007
#define C3DHALL12I2C_TEMP_SIGN_BIT   0x0800
 3D Hall 12 I2C data calculation setting.
#define C3DHALL12I2C_TEMP_SIGN_MASK   0xF000
#define C3DHALL12I2C_TEMP_RES   8.052
#define C3DHALL12I2C_TEMP_OFFSET   25.0
#define C3DHALL12I2C_XYZ_SIGN_BIT   0x4000
#define C3DHALL12I2C_XYZ_SIGN_MASK   0x8000
#define C3DHALL12I2C_XYZ_RES_MT   248.2
#define C3DHALL12I2C_ANGLE_RES_DEG   0.0109863
#define C3DHALL12I2C_DEVICE_ADDRESS   0x65
 3D Hall 12 I2C device address setting.
#define C3DHALL12I2C_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.

Enumerations

enum  c3dhall12i2c_return_value_t { C3DHALL12I2C_OK = 0 , C3DHALL12I2C_ERROR = -1 , C3DHALL12I2C_DATA_NOT_READY = -2 }
 3D Hall 12 I2C Click return value data. More...

Functions

void c3dhall12i2c_cfg_setup (c3dhall12i2c_cfg_t *cfg)
 3D Hall 12 I2C configuration object setup function.
err_t c3dhall12i2c_init (c3dhall12i2c_t *ctx, c3dhall12i2c_cfg_t *cfg)
 3D Hall 12 I2C initialization function.
err_t c3dhall12i2c_default_cfg (c3dhall12i2c_t *ctx)
 3D Hall 12 I2C default configuration function.
err_t c3dhall12i2c_write_reg (c3dhall12i2c_t *ctx, uint8_t reg, uint16_t data_in)
 3D Hall 12 I2C write register function.
err_t c3dhall12i2c_read_reg (c3dhall12i2c_t *ctx, uint8_t reg, uint16_t *data_out)
 3D Hall 12 I2C read register function.
void c3dhall12i2c_set_sample_pin (c3dhall12i2c_t *ctx, uint8_t state)
 3D Hall 12 I2C set sample pin function.
uint8_t c3dhall12i2c_get_int_pin (c3dhall12i2c_t *ctx)
 3D Hall 12 I2C get INT pin function.
void c3dhall12i2c_start_measurement (c3dhall12i2c_t *ctx)
 3D Hall 12 I2C start measurement function.
err_t c3dhall12i2c_read_data (c3dhall12i2c_t *ctx, c3dhall12i2c_data_t *data_out)
 3D Hall 12 I2C read data function.

Detailed Description

This file contains API for 3D Hall 12 I2C Click Driver.

Enumeration Type Documentation

◆ c3dhall12i2c_return_value_t

3D Hall 12 I2C Click return value data.

Predefined enum values for driver return values.

Enumerator
C3DHALL12I2C_OK 
C3DHALL12I2C_ERROR 
C3DHALL12I2C_DATA_NOT_READY